package com.rizzo.analytics.domain.info;

import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: jalie
 * Date: 11/24/12
 * Time: 12:27 PM
 * To change this template use File | Settings | File Templates.
 */
public class Instance implements Serializable, Comparable<Instance> {

	private static final long serialVersionUID = 16L;

	private String instanceName;
	private String instanceIndex;

	public Instance() {
	}

	public Instance(String instanceName, String instanceIndex) {
		this.instanceName = instanceName;
		this.instanceIndex = instanceIndex;
	}

	public String getInstanceName() {
		return instanceName;
	}

	public void setInstanceName(String instanceName) {
		this.instanceName = instanceName;
	}

	public String getInstanceIndex() {
		return instanceIndex;
	}

	public void setInstanceIndex(String instanceIndex) {
		this.instanceIndex = instanceIndex;
	}

	@Override
	public int compareTo(Instance o) {
		if (this.getInstanceName().equals(o.getInstanceName())) {
			return this.getInstanceIndex().compareTo(o.getInstanceIndex());
		} else {
			return this.getInstanceName().compareTo(o.getInstanceName());
		}
	}
}
